﻿<?xml version="1.0" encoding="utf-8"?>
<witd:WITD application="Work item type editor" version="1.0" xmlns:witd="http://schemas.microsoft.com/VisualStudio/2005/workitemtracking/typedef">
  <WORKITEMTYPE name="Stuff">
    <DESCRIPTION>Extra stuff</DESCRIPTION>
    <FIELDS>
      <FIELD name="Title" refname="System.Title" type="String" reportable="dimension">
        <HELPTEXT>Short description of the task used to differentiate it in a list or report</HELPTEXT>
        <REQUIRED />
      </FIELD>
      <FIELD name="State" refname="System.State" type="String" reportable="dimension">
        <HELPTEXT>The workflow state of the task</HELPTEXT>
      </FIELD>
      <FIELD name="Rev" refname="System.Rev" type="Integer" reportable="dimension" />
      <FIELD name="Changed By" refname="System.ChangedBy" type="String" reportable="dimension">
        <VALIDUSER />
      </FIELD>
      <FIELD name="Issue" refname="Microsoft.VSTS.Common.Issue" type="String" reportable="dimension">
        <HELPTEXT>Used to highlight a task, e.g., to mark it as an issue</HELPTEXT>
        <REQUIRED />
        <ALLOWEDVALUES expanditems="true">
          <LISTITEM value="Yes" />
          <LISTITEM value="No" />
        </ALLOWEDVALUES>
        <DEFAULT from="value" value="No" />
      </FIELD>
      <FIELD name="State Change Date" refname="Microsoft.VSTS.Common.StateChangeDate" type="DateTime">
        <WHENCHANGED field="System.State">
          <SERVERDEFAULT from="clock" />
        </WHENCHANGED>
        <WHENNOTCHANGED field="System.State">
          <READONLY />
        </WHENNOTCHANGED>
      </FIELD>
      <FIELD name="Assigned To" refname="System.AssignedTo" type="String" reportable="dimension">
        <VALIDUSER />
      </FIELD>
      <FIELD name="Work Item Type" refname="System.WorkItemType" type="String" reportable="dimension" />
      <FIELD name="Closed By" refname="Microsoft.VSTS.Common.ClosedBy" type="String" reportable="dimension">
        <WHENNOTCHANGED field="System.State">
          <READONLY />
        </WHENNOTCHANGED>
      </FIELD>
      <FIELD name="Closed Date" refname="Microsoft.VSTS.Common.ClosedDate" type="DateTime" reportable="dimension">
        <WHENNOTCHANGED field="System.State">
          <READONLY />
        </WHENNOTCHANGED>
      </FIELD>
      <FIELD name="Created Date" refname="System.CreatedDate" type="DateTime" reportable="dimension" />
      <FIELD name="Created By" refname="System.CreatedBy" type="String" reportable="dimension" />
      <FIELD name="Integration Build" refname="Microsoft.VSTS.Build.IntegrationBuild" type="String" reportable="dimension">
        <HELPTEXT>The build in which the task was completed</HELPTEXT>
        <SUGGESTEDVALUES expanditems="true">
          <LISTITEM value="&lt;None&gt;" />
        </SUGGESTEDVALUES>
      </FIELD>
      <FIELD name="Discipline" refname="Microsoft.VSTS.Common.Discipline" type="String" reportable="dimension">
        <HELPTEXT>The discipline to which the task belongs</HELPTEXT>
        <ALLOWEDVALUES expanditems="true">
          <LISTITEM value="Development" />
          <LISTITEM value="Test" />
          <LISTITEM value="Project Management" />
          <LISTITEM value="Requirements" />
          <LISTITEM value="Architecture" />
          <LISTITEM value="Release Management" />
        </ALLOWEDVALUES>
      </FIELD>
      <FIELD name="Task Hierarchy" refname="Microsoft.VSTS.Scheduling.TaskHierarchy" type="String" reportable="dimension">
        <HELPTEXT>A string representing MS-Project context for the given task</HELPTEXT>
      </FIELD>
      <FIELD name="Start Date" refname="Microsoft.VSTS.Scheduling.StartDate" type="DateTime" reportable="dimension">
        <HELPTEXT>The date to start the task</HELPTEXT>
      </FIELD>
      <FIELD name="Exit Criteria" refname="Microsoft.VSTS.Common.ExitCriteria" type="String" reportable="dimension">
        <HELPTEXT>Flag to determine if this scenario should be tracked as an exit criteria for the iteration</HELPTEXT>
        <REQUIRED />
        <ALLOWEDVALUES expanditems="true">
          <LISTITEM value="Yes" />
          <LISTITEM value="No" />
        </ALLOWEDVALUES>
        <DEFAULT from="value" value="No" />
      </FIELD>
      <FIELD name="Description" refname="System.Description" type="PlainText" />
      <FIELD name="History" refname="System.History" type="History">
        <HELPTEXT>Discussion thread and other historical information</HELPTEXT>
      </FIELD>
      <FIELD name="RelatedLinkCount" refname="System.RelatedLinkCount" type="Integer" />
      <FIELD name="Iteration Path" refname="System.IterationPath" type="TreePath" reportable="dimension">
        <HELPTEXT>The iteration of the product with which this task is associated</HELPTEXT>
      </FIELD>
      <FIELD name="IterationID" refname="System.IterationId" type="Integer" />
      <FIELD name="ExternalLinkCount" refname="System.ExternalLinkCount" type="Integer" />
      <FIELD name="Team Project" refname="System.TeamProject" type="String" reportable="dimension" />
      <FIELD name="HyperLinkCount" refname="System.HyperLinkCount" type="Integer" />
      <FIELD name="AttachedFileCount" refname="System.AttachedFileCount" type="Integer" />
      <FIELD name="Node Name" refname="System.NodeName" type="String" />
      <FIELD name="Area Path" refname="System.AreaPath" type="TreePath" reportable="dimension">
        <HELPTEXT>The area of the product with which this task is associated</HELPTEXT>
      </FIELD>
      <FIELD name="Revised Date" refname="System.RevisedDate" type="DateTime" />
      <FIELD name="Changed Date" refname="System.ChangedDate" type="DateTime" reportable="dimension" />
      <FIELD name="ID" refname="System.Id" type="Integer" reportable="dimension" />
      <FIELD name="AreaID" refname="System.AreaId" type="Integer" />
      <FIELD name="Authorized As" refname="System.AuthorizedAs" type="String" />
    </FIELDS>
    <WORKFLOW>
      <STATES>
        <STATE value="Active">
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
              <EMPTY />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
              <EMPTY />
            </FIELD>
          </FIELDS>
        </STATE>
        <STATE value="Closed" />
      </STATES>
      <TRANSITIONS>
        <TRANSITION from="" to="Active">
          <REASONS>
            <DEFAULTREASON value="New" />
          </REASONS>
          <FIELDS>
            <FIELD refname="System.AssignedTo">
              <DEFAULT from="currentuser" />
            </FIELD>
          </FIELDS>
        </TRANSITION>
        <TRANSITION from="Active" to="Closed">
          <REASONS>
            <DEFAULTREASON value="Completed" />
            <REASON value="Deferred" />
            <REASON value="Obsolete" />
            <REASON value="Cut" />
          </REASONS>
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
              <SERVERDEFAULT from="clock" />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
              <COPY from="currentuser" />
              <VALIDUSER />
              <REQUIRED />
            </FIELD>
          </FIELDS>
          <ACTIONS>
            <ACTION value="Microsoft.VSTS.Actions.Checkin" />
          </ACTIONS>
        </TRANSITION>
        <TRANSITION from="Closed" to="Active">
          <REASONS>
            <DEFAULTREASON value="Reactivated" />
          </REASONS>
          <FIELDS>
             <FIELD refname="System.AssignedTo">
              <COPY from="field" field="Microsoft.VSTS.Common.ClosedBy" />
            </FIELD>
          </FIELDS>
        </TRANSITION>
      </TRANSITIONS>
    </WORKFLOW>
    <FORM>
      <!-- Guidelines for updating the form section
     1) All labels should have mnemonics (you must use &amp; not just &)
     2) No mnemonics on Tabs or Group Boxes
     3) Labels must use sentence casing (i.e. "Assigned to:" is correct; "Assigned To:" is wrong)
     4) No colons in Group Boxes
     5) Label names should match the field name in whole or in part. They should not be completely different.
     6) Do not use the same mnemonics on two labels
     
     The following mnemonics are common to MSF Agile work items:
     T -> Title
     A -> Area
     I -> Iteration
     G -> Assigned to
     S -> State
     R -> Reason
     H -> Comment and history
     U -> Issue
     B -> Integration build
     C -> Description
     E -> Start Date
     F -> Finish Date
     
     The following mnemonics are also used on this work item type
     D -> Discipline
     K -> Rank
     X -> Exit criteria
     W -> Remaining work
     P -> Completed work
     O -> Task Context
   -->
      <Layout>
        <Group>
          <Column PercentWidth="70">
            <Control Type="FieldControl" FieldName="System.Title" Label="&amp;Title:" LabelPosition="Left" />
          </Column>
          <Column PercentWidth="30">
            <Control Type="FieldControl" FieldName="Microsoft.VSTS.Common.Discipline" Label="&amp;Discipline:" LabelPosition="Left" />
          </Column>
        </Group>
        <Group Label="Classification">
          <Column PercentWidth="100">
            <Control Type="WorkItemClassificationControl" FieldName="System.AreaPath" Label="&amp;Area:" LabelPosition="Left" />
            <Control Type="WorkItemClassificationControl" FieldName="System.IterationPath" Label="&amp;Iteration:" LabelPosition="Left" />
          </Column>
        </Group>
        <Group Label="Status">
          <Column PercentWidth="50">
            <Control Type="FieldControl" FieldName="System.AssignedTo" Label="Assi&amp;gned to:" LabelPosition="Left" />
          </Column>
          <Column PercentWidth="50">
            <Control Type="FieldControl" FieldName="System.State" Label="&amp;State:" LabelPosition="Left" />
            <Control Type="FieldControl" FieldName="System.Reason" Label="&amp;Reason:" LabelPosition="Left" />
          </Column>
        </Group>
        <TabGroup>
          <Tab Label="Description">
            <Control Type="HtmlFieldControl" FieldName="System.Description" Label="Des&amp;cription:" LabelPosition="Top" Dock="Fill" />
          </Tab>
          <Tab Label="History">
            <Control Type="WorkItemLogControl" FieldName="System.History" Label="&amp;History:" LabelPosition="Top" Dock="Fill" />
          </Tab>
          <Tab Label="Links">
            <Control Type="LinksControl" />
          </Tab>
          <Tab Label="File Attachments">
            <Control Type="AttachmentsControl" />
          </Tab>
          <Tab Label="Details">
            <Group>
              <Column PercentWidth="50">
                <Group Label="General">
                  <Column PercentWidth="100">
                    <Control Type="FieldControl" FieldName="Microsoft.VSTS.Common.Issue" Label="Iss&amp;ue:" LabelPosition="Left" />
                    <Control Type="FieldControl" FieldName="Microsoft.VSTS.Common.ExitCriteria" Label="E&amp;xit criteria:" LabelPosition="Left" />
                    <Control Type="FieldControl" FieldName="Microsoft.VSTS.Build.IntegrationBuild" Label="Integration &amp;build:" LabelPosition="Left" />
                    <Control Type="FieldControl" FieldName="Microsoft.VSTS.Scheduling.TaskHierarchy" Label="Task C&amp;ontext:" LabelPosition="Left" ReadOnly="True" />
                  </Column>
                </Group>
              </Column>
              
            </Group>
          </Tab>
        </TabGroup>
      </Layout>
    </FORM>
  </WORKITEMTYPE>
</witd:WITD>